import UIKit
import Speech
import PlaygroundSupport

var numbers: [String] = []
for q in 1...4 {
    for n in 1...8 {
        numbers.append("\(q)\(n)")
    }
}

let data = SFCustomLanguageModelData(locale: Locale(identifier: "ru_RU"), identifier: "in.malash.DentalFormula", version: "1.0") {
    SFCustomLanguageModelData.PhraseCount(phrase: "Зуб 17 кариес пломба", count: 10)
    
//    SFCustomLanguageModelData.PhraseCountsFromTemplates(classes: [
//        "number": numbers,
//        "defect": ["кариес", "пломба", "удалён", "кариес-пломба", "пломба-кариес"]
//    ]) {
//        SFCustomLanguageModelData.TemplatePhraseCountGenerator.Template("Зуб <number> <defect>", count: 10000)
//    }
}

let dataFile = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("data.bin")

try await data.export(to: dataFile)

//
//let x = "some"
//try x.write(to: dataFile, atomically: true, encoding: .utf8)
